import request from '@/utils/request'
export default {
    // 分页条件查询分类列表
    getList(query, current = 1, size = 20) {
        return request({
            url: '/article/category/search',
            method: 'POST',
            data: {
                // {name:'前端',status:1,current:1,size:1}
                ...query,
                current,
                size
            }
        })
    },
    // 添加数据
    add(data) {
        return request({
            url: `/article/category`,
            method: "POST",
            data
        })
    },
    // 根据id获取编辑数据
    getById(id) {
        return request({
            url: `/article/category/${id}`,
            method: 'GET',
        })
    },
    // 编辑数据的提交
    update(data) {
        return request({
            url: `/article/category`,
            method: 'PUT',
            data
        })
    },
    // 删除数据
    delete(id) {
        return request({
            url: `/article/category/${id}`,
            method: 'delete',
        })
    },
    // 查询正常状态的分类
    getNormaList() {
        return request({
            url: '/article/category/list',
            method: 'get'
        })
    }

}